package edu.sctu.zhuyingzhi.month201505.day20150522.treadTest;

/**
 * Created by user13 on 2015/5/20.
 */
public class Consumer extends Thread{
    private String name;
    private Store s;

    public Consumer(String name, Store s){
        this.s = s;
        this.name = name;
    }

    public void run(){


            while(true){

                s.consume(name);
                try {
                    sleep(1000);
                }catch (Exception e){
                    System.out.println("中断");
                }
            }



    }

}
